# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
;cpredor2d (TopSpin 3.0)
;
; TS3 / 03.06.2011
;
; checked by SEWE 02.08.2011
;
;2d REDOR  experiment 
;interleaved acquisition of S and S0 signal
;written by STE 26.11.2002
;
;Avance III version
;parameters:
;pl1 : X power level for contact
;pl2 : =0W, not used
;pl3 : Y power level for 180
;pl11 : X power level for 180
;pl12 : proton power level for decoupling
;pl13 : e.g. used in spinal64_13
;pl22 : =0W (no recoupling pulses)
;sp0 : proton power level during contact
;p2 : X 180 degree pulse at pl11
;p3 : proton 90 at power level pl12
;p12 : Y 180 degree pulse at pl3
;p15 : contact time at pl1 (f1) and pl2 (f2)
;pcpd2 : pulse length in decoupling sequence
;cpdprg2 : cw, tppm (at pl12), 
;cnst31 : spin rate >1 kHz
;l0 : 1,3.... must be odd for rotor sync
;d2 : recycle delay
;d31 : used to check spin rate
;spnam0 : file name for variable amplitude CP
;
;
;$CLASS=Solids
;$DIM=pseudo 2D
;$TYPE=cross polarisation
;$SUBTYPE=heteronuclear recoupling
;$COMMENT=REDOR  experiment, cp for excitation, interleaved acquisition of S and S0 signals


"plw22=0"				;make sure reference exp. has no recoupling pulses (TS 3.0)
# 43 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
define delay del25		;calculate sync. delays
"del25=(0.25s/cnst31)"
define delay del26
"del26=(0.25s/cnst31)-(p12/2)"
define delay del27
"del27=(0.25s/cnst31)-(p2/2)"
define loopcounter nfid
"nfid=td1/2"
"d31=1s/cnst31"
"acqt0=0"

# 54 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
1 ze
  d31
2 10m do:f2

3 d20 pl12:f2
  (p3 pl12 ph0):f2
  lo to 3 times l20
4 d2
# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/p15_prot.incl" 1
;p15_prot.incl
;avance-version (13/01/29)
;Test the rf on-time and duty cycle
;protect against too long contact time
;Test the rf on-time and duty cycle 
;
;$CLASS=Solids INCL
;$COMMENT=protect against too long contact time


1m
if "p15 < 10.1m" goto Passp15
2u
print "contact time exceeds 10msec limit!"
goto HaltAcqu
Passp15, 1m
# 20 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/p15_prot.incl"
;$Id: p15_prot.incl,v 1.8 2013/01/29 15:40:14 ber Exp $
# 63 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx" 2
			;make sure p15 does not exceed 10 msec	
			;let supervisor change this pulseprogram if 
			;more is needed

# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/aq_prot.incl" 1
;aq_prot.incl
;avance-version (13/01/28)
;Test the rf on-time and duty cycle
;protect against too long acquisition time

;$CLASS=Solids INCL
;$COMMENT=protect against too long acquisition time
# 9 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/aq_prot.incl"
1m
if "aq < 50.1m" goto Passaq
2u 
print "acquisition time exceeds 50m limit!"
goto HaltAcqu
Passaq, 1m

;$Id: aq_prot.incl,v 1.8 2013/01/28 17:39:02 ber Exp $
# 67 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx" 2
			;allows max. 50 msec acquisition time, supervisor
			;may change  to max. 1s at less than 5 % duty cycle
			;and reduced decoupling field

# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/rot_prot.incl" 1
;rot_prot.incl
;avance-version (13/01/29)
;Test the rf on-time and duty cycle
;protect against misset cnst31, rotation speed below 1000 Hz
;
;$CLASS=Solids INCL
;$COMMENT=protect against misset cnst31, rotation speed below 1000 Hz
# 10 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/rot_prot.incl"
1m
if "d31 < 1m" goto Passrot
2u
print "rotation period too long, cnst31 misset to less than 1000 Hz!"
goto HaltAcqu
Passrot, 1m


# 19 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/rot_prot.incl"
;$Id: rot_prot.incl,v 1.8 2013/01/29 15:40:14 ber Exp $
# 71 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx" 2
			;protect against misset cnst31, must be >1000
  2u rpp9
  2u rpp8
  (p3 pl12 ph1):f2
  (p15 pl1 ph2):f1 (p15:sp0 ph10):f2
  del25  cpds2:f2
5 del26 
  (p12 pl3 ph8^):f3
  del26
  lo to 5 times l0     ; was lo to 3
  del27
  (p2 pl11 ph4):f1
  del27
6 del26
  (p12 ph9^):f3
  del26
  lo to 6 times l0			; was lo to 4
  del25	
  go=2 ph31
  1m do:f2
  30m wr #0 if #0 zd

12 10m do:f2

13 d20 pl12:f2
  (p3 pl12 ph0):f2
  lo to 13 times l20
# 99 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
14 d2
  2u rpp9
  2u rpp8
  (p3 pl12 ph1):f2
  (p15 pl1 ph2):f1 (p15:sp0 ph10):f2
  del25  cpds2:f2
15 del26 
  (p12 pl22 ph8^):f3
  del26
  lo to 15 times l0			; was lo to 13
  del27
  (p2 pl11 ph4):f1
  del27
16 del26
  (p12 ph9^):f3
  del26
  lo to 16 times l0				; was lo to 14
  del25	
  go=12 ph31
  1m do:f2
  30m wr #0 if #0 zd
  10u iu0
  10u iu0
  10u iu0
  10u iu0
  10u iu0
  10u iu0
  10u iu0
  10u iu0
  lo to 2 times nfid
HaltAcqu, 1m
exit

ph0= 0
ph1= 1 3
ph2= 0 0 1 1 2 2 3 3
ph4= 0 0 1 1 0 0 1 1
ph8= 0 1 0 1 1 0 1 0
ph9= 0 1 0 1 1 0 1 0
ph10= 0
ph31= 0 2 1 3 2 0 3 1

# 143 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/presat_cpredori.dx"
;$Id: cpredori,v 1.2.18.3 2012/10/09 09:20:42 ber Exp $

